﻿@model Event

@{
    ViewBag.Title = "Opret nyt event";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-calendar"></span> @ViewBag.Title</h1>
</div>

<div class="hidden-xs">
    <p>
        Når du opretter nye events, så sørg for at give en god beskrivelse, således at andre spillere er godt informeret. Husk, når du opretter et event, vil du automatisk selv blive tilmeldt - og ligeledes sendes en mail til andre spillere med information om det nye event.
        <hr />
    </p>
</div>

@if (!ViewData.ModelState.IsValid)
{
    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        @Html.ValidationSummary("", new { @style = "color: #fff;" })
    </div>
}

@using (Html.BeginForm("Create", "Event", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()

    @Html.EditorFor(x => x.StartDate, new { minDate = DateTime.Today })
    
    <div class="form-group">
        <label class="col-sm-2 col-lg-2 control-label">type</label>
        <div class="col-sm-6">
            <select class="form-control" id="EventTypeId" name="EventTypeId">
                <option selected value="2">Almindelig match</option>
                <option value="1">Major</option>
                <option value="4">Social event</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="Name" class="col-sm-2 col-lg-2 control-label">navn</label>
        <div class="col-sm-6">
            <input type="text" id="Name" name="Name" class="form-control" required value="@Model.Name" placeholder="Find på et godt navn til eventet">
        </div>
    </div>
    <div class="form-group">
        <label for="Content" class="col-sm-2 col-lg-2 control-label">beskrivelse</label>
        <div class="col-sm-6">
            <textarea id="Content" name="Content" rows="5" cols="25" class="form-control" required placeholder="Skriv en god og fyldestgørende beskrivelse af eventet"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="CourseId" class="col-sm-2 col-lg-2 control-label">klub</label>
        <div class="col-sm-6">
            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-home"></span></span>
                @Html.DropDownListFor(m => m.CourseId, new SelectList(ViewBag.Courses, "Id", "Name"), "Vælg bane..", new { @class = "form-control" })
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="Location" class="col-sm-2 col-lg-2 control-label">hvor?</label>
        <div class="col-sm-6">
            <input type="text" id="Location" name="Location" class="form-control" placeholder="Angiv adresse eller lign for eventet, hvis ikke der vælges en klub">
        </div>
    </div>

    @Html.EditorFor(x => x.JoinByDate, new { minDate = DateTime.Today })
    
    @Html.EditorFor(x=>x.MeetingTime)
    
    @Html.EditorFor(x=>x.StartingTime)
    
    <div class="form-group">
        <label for="EntryFee" class="col-sm-2 col-lg-2 control-label">matchfee</label>
        <div class="col-sm-3 col-lg-2">
            <div class="input-group">
                <span class="input-group-addon">kr.</span>
                <input type="number" id="EntryFee" name="EntryFee" pattern="^[0-9]+$" class="form-control" title="Angiv pris ekskl. eventuelt greenfee">
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="create" class="col-sm-2 col-lg-2 control-label"></label>
        <div class="col-sm-8">
            <button type="submit" class="btn btn-default">opret</button>
        </div>
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/globalize")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/Scripts/_thecup_editing.js")
}
